package vek.XML.Parsers;

import org.xml.sax.ContentHandler;
import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
import vek.XML.parsedObjects.ParsedNonComercial;


/**
 * Parses Non Comercial POIs.
 * @see XMLParserPOI
 * @author Christian, Michal og Jakob (Hold 1, gruppe 2)
 */
public abstract class XMLParserNonComercial extends XMLParserAttractions implements ContentHandler {
    
    //parsing variables
    private boolean parsingNonComercialPOI;
    protected ParsedNonComercial ParsedNonComercial;


    @Override
    public void startElement(String uri, String localName, String qName, Attributes atts) throws SAXException {
        
        super.startElement(uri, localName, qName, atts);
        
        if(localName.equals("noncomercialpoi"))
            {
                parsingNonComercialPOI = true;
            }
        if(parsingNonComercialPOI)
            {
                setTopElementStartTagsNonComercial(uri, localName, qName, atts);
            }
        
    }

    @Override
    public void endElement(String uri, String localName, String qName) throws SAXException {   
        
        super.endElement(uri, localName, qName);
        
        if(localName.equals("noncomercialpoi"))
            {
                parsingNonComercialPOI = false;
                ParsedNonComercial = new ParsedNonComercial(parsedAttraction);
            }
        if(parsingNonComercialPOI)
            {
                setTopElementEndTagsNonComercial(uri, localName, qName);
            }
        
    }
    
    private void setTopElementEndTagsNonComercial(String uri, String localName, String qName) throws SAXException 
    {
       
    }
    
    private void setTopElementStartTagsNonComercial(String uri, String localName, String qName, Attributes atts) throws SAXException
    {
        
    }
  
    
 
    

    

    
    

}
